/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 2.0
 *
 * Copyright 2011-2022 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */
define(["exports","./Matrix2-f9a8df5e","./Matrix3-80f44511","./Check-de3c6afc","./OrientedBoundingBox-158fbae3"],(function(n,t,e,r,a){"use strict";const i={},o=new e.Cartesian3,u=new e.Cartesian3,s=new e.Cartesian3,c=new e.Cartesian3,C=new a.OrientedBoundingBox;function m(n,r,a,i,u){const s=e.Cartesian3.subtract(n,r,o),c=e.Cartesian3.dot(a,s),C=e.Cartesian3.dot(i,s);return t.Cartesian2.fromElements(c,C,u)}i.validOutline=function(n){const t=a.OrientedBoundingBox.fromPoints(n,C).halfAxes,r=e.Matrix3.getColumn(t,0,u),i=e.Matrix3.getColumn(t,1,s),o=e.Matrix3.getColumn(t,2,c),m=e.Cartesian3.magnitude(r),f=e.Cartesian3.magnitude(i),d=e.Cartesian3.magnitude(o);return!(0===m&&(0===f||0===d)||0===f&&0===d)},i.computeProjectTo2DArguments=function(n,t,r,i){const o=a.OrientedBoundingBox.fromPoints(n,C),m=o.halfAxes,f=e.Matrix3.getColumn(m,0,u),d=e.Matrix3.getColumn(m,1,s),g=e.Matrix3.getColumn(m,2,c),l=e.Cartesian3.magnitude(f),x=e.Cartesian3.magnitude(d),M=e.Cartesian3.magnitude(g),B=Math.min(l,x,M);if(0===l&&(0===x||0===M)||0===x&&0===M)return!1;let P,h;return B!==x&&B!==M||(P=f),B===l?P=d:B===M&&(h=d),B!==l&&B!==x||(h=g),e.Cartesian3.normalize(P,r),e.Cartesian3.normalize(h,i),e.Cartesian3.clone(o.center,t),!0},i.createProjectPointsTo2DFunction=function(n,t,e){return function(r){const a=new Array(r.length);for(let i=0;i<r.length;i++)a[i]=m(r[i],n,t,e);return a}},i.createProjectPointTo2DFunction=function(n,t,e){return function(r,a){return m(r,n,t,e,a)}},n.CoplanarPolygonGeometryLibrary=i}));
